<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书管理系统登录</title>
    <link rel="stylesheet" th:href="@{/loginStyles.css}">
    <!-- 引入 Google Fonts 以使用更现代的字体 -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="login-box">
        <h2>图书管理系统登录</h2>
        <ul class="tabs">
            <li class="tab active" data-target="user-login">用户登录</li>
            <li class="tab" data-target="admin-login">管理员登录</li>
            <li class="tab" data-target="register">注册</li>
        </ul>
        <div class="tab-content">
            <div id="user-login" class="tab-pane active">
                <form id="user-login-form" th:action="@{/login/log}" method="post">
                    <label>
                        <input type="text" name="username" placeholder="用户名" required>
                    </label>
                    <label>
                        <input type="password" name="password" placeholder="密码" required>
                    </label>
                    <button type="submit">登录</button>
                </form>
            </div>
            <div id="admin-login" class="tab-pane">
                <form id="admin-login-form" th:action="@{/login/manager}" method="post">
                    <label>
                        <input type="text" name="username" placeholder="管理员用户名" required>
                    </label>
                    <label>
                        <input type="password" name="password" placeholder="管理员密码" required>
                    </label>
                    <button type="submit">登录</button>
                </form>
            </div>
            <div id="register" class="tab-pane">
                <form id="register-form" th:action="@{/login/register}" method="post">
                    <label>
                        <input type="text" name="username" placeholder="用户名" required>
                    </label>
                    <label>
                        <input type="password" name="password" placeholder="密码" required>
                    </label>
                    <label>
                        <input type="email" name="email" placeholder="邮箱" required>
                    </label>
                    <button type="submit">注册</button>
                </form>
            </div>
        </div>
    </div>
    <span class="message" style="color: yellow" th:text="${message}"></span>
</div>
<script th:src="@{/loginScript.js}"></script>
</body>
</html>